#region Summary

// 
// Owner : JackieHan 
// 
// Solution : ResearchTest 
// 
// Project : jackie.Research.Wcf.Normal.ClientTest
// 
// File : TestCalculatorService.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 测试服务
// 
// History : 
//			2011-04-26 10:49:58	    Create 
// 

#endregion

#region Using

using System;
using System.ServiceModel;
using System.Threading;
using Jackie.Research.Wcf.Normal.Contracts;
using jackie.Research.Wcf.Normal.Services;
using NUnit.Framework;

#endregion

namespace jackie.Research.Wcf.Normal.ClientTest
{
    /// <summary> 
    /// 测试服务
    /// </summary>
    [TestFixture]
    public class TestCalculatorService
    {

        [SetUp]
        public void SetUp()
        {
        }

        [Test]
        public void TestCallback()
        {
            var callbackInstance = new InstanceContext(new CalculatorCallback());
            using (var clientChannel = new DuplexChannelFactory<ICalculator>(callbackInstance, "CalculatorCallbackService"))
            {
                var client = clientChannel.CreateChannel();
                client.Add(4, 6);
            }

            Thread.Sleep(60000);
        }

        [TearDown]
        public void TearDown()
        {
        }

    }
}